#ifndef CHILDSELECTOR_H_INCLUDED_XAIRY
#define CHILDSELECTOR_H_INCLUDED_XAIRY

#include "Selector.h"
#include "Condition.h"
#include "CSSException.h"

class SimpleSelector : public Selector
{

};

class SiblingSelector : public Selector
{
public:
	static short ANY_NODE;

	virtual short getNodeType()const = 0;
	virtual const Selector& getSelector()const = 0;
	virtual const Selector& getSiblingSelector()const = 0;
};

class DescendantSelector : public Selector
{
public:
	virtual const Selector& getAncestorSelector()const = 0;
	virtual const SimpleSelector& getSimpleSelector()const = 0;
};

class CharacterDataSelector : public SimpleSelector
{
public:
	virtual const string& getData()const = 0;
};

class ConditionalSelector : public  SimpleSelector
{
public:
	virtual const SimpleSelector& getSimpleSelector()const = 0;
	virtual const Condition& getCondition()const = 0;
};

class ElementSelector : public SimpleSelector
{
public:
	virtual const string* getNamespaceURI()const = 0;
	virtual const string* getLocalName()const = 0;
};

class NegativeSelector : public SimpleSelector
{
public:
	virtual const SimpleSelector& getSimpleSelector()const = 0;
};

class ProcessingInstructionSelector : public SimpleSelector
{
public:
	const string* getTarget()const;
	const string* getData()const;
};

class SelectorFactory
{
public:
	virtual ConditionalSelector* createConditionalSelector(SimpleSelector* selector,
						  Condition* condition)throw(CSSException) = 0;

	virtual SimpleSelector* createAnyNodeSelector()throw(CSSException) = 0;

	virtual SimpleSelector* createRootNodeSelector()throw(CSSException) = 0;

	virtual NegativeSelector* createNegativeSelector(SimpleSelector* selector)
											 throw(CSSException) = 0;

	virtual ElementSelector* createElementSelector(const string* namespaceURI,
										   const string& tagName)
										   throw(CSSException) = 0;

	virtual CharacterDataSelector* createTextNodeSelector(const string& data)
										   throw(CSSException) = 0;

	virtual CharacterDataSelector* createCDataSectionSelector(const string& data)
										   throw(CSSException) = 0;

	virtual ProcessingInstructionSelector*
	createProcessingInstructionSelector(const string& target,
										const string& data)
										throw(CSSException) = 0;

	virtual CharacterDataSelector* createCommentSelector(const string& data)
										throw(CSSException) = 0;

	virtual ElementSelector* createPseudoElementSelector(const string* namespaceURI,
										const string& pseudoName)
										throw(CSSException) = 0;

	virtual DescendantSelector* createDescendantSelector(Selector* parent,
												 SimpleSelector* descendant)
												 throw(CSSException) = 0;

	virtual DescendantSelector* createChildSelector(Selector* parent,
											SimpleSelector* child)
											throw(CSSException) = 0;

	virtual SiblingSelector* createDirectAdjacentSelector(short nodeType,
												  Selector* child,
												  SimpleSelector* directAdjacent)
											throw(CSSException) = 0;
};


#endif // CHILDSELECTOR_H_INCLUDED
